package tjs.study.notes.dotest.jdk.reference;

import tjs.study.notes.dotest.jvm.heap.UserJvm;

import java.io.Closeable;
import java.io.IOException;
import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;

public class ConnectionHolder extends PhantomReference<UserJvm> implements Closeable {
    //public static final ReferenceQueue<UserJvm> queue = new ReferenceQueue();

    public ConnectionHolder(UserJvm referent, ReferenceQueue<UserJvm> queue) {
        super(referent, queue);
    }


    @Override
    public void close() throws IOException {
        System.out.println("清理堆外资源...");
    }
}